package com.qingcloud.df.executor.enums;


/**
 * 调度类型枚举
 * @author yangfan
 * @date 2022/02/17
 */
public enum ScheduleTypeEnum {

    /**
     *无
     */
    NONE("无"),

    /**
     * 定时任务cron
     */
    CRON("CRON"),

    /**
     * 固定速度
     */
    FIX_RATE("固定速度"),

    ;

    private final String title;

    ScheduleTypeEnum(String title) {
        this.title = title;
    }

    public String getTitle() {
        return title;
    }

    public static ScheduleTypeEnum match(String name, ScheduleTypeEnum defaultItem){
        for (ScheduleTypeEnum item: ScheduleTypeEnum.values()) {
            if (item.name().equals(name)) {
                return item;
            }
        }
        return defaultItem;
    }

}
